<div class="builder listbuilder-box">

	<?php if ($this->buttons || $this->enable_search) { ?>
	<!-- 顶部工具栏按钮 -->
	<div class="builder-toolbar">
		<div class="row">
		
	        <!-- 工具栏按钮 -->
			<div class="col-xs-12 col-sm-8 button-list clearfix">
				<div class="form-group">
					<?php foreach ($this->buttons as $button) {
						echo $button->render_html() . '&nbsp;&nbsp;';
					} ?>
				</div>
			</div>
        
	        <!-- 搜索框 -->
			<div class="col-xs-12 col-sm-4 clearfix">
				<?php if ($this->enable_search) { ?>
				<form class="form" method="get" action="<?php echo request()->baseUrl(); ?>">
					<div class="form-group">
						<div class="input-group search-form">
							<input type="text" name="s_word" class="search-input form-control" value="<?php echo $this->search_word; ?>" placeholder="请输入搜索关键字">
							<span class="input-group-btn"><a class="btn btn-default search-btn"><i class="fa fa-search"></i></a></span>
						</div>
					</div>
				</form>
				<?php } ?>
			</div>
			
		</div>
	</div>
	<?php } ?>
	
	<!-- 数据列表 -->
    <div class="builder-container">
        <div class="row">
            <div class="col-xs-12">
                <div class="builder-table">
                    <div class="panel panel-default table-responsive">
                    	<table class="table table-bordered table-striped table-hover">
                    		
                    		<thead>
                    			<tr>
                    				<?php foreach ($this->columns as $column) {
							            echo $column->render_head();
							        } ?>
                    			</tr>
                    		</thead>
                    		
                    		<tbody>
	                    		<?php if ($this->data_list) {

						            foreach ($this->data_list as $row) {
						                echo '<tr>';
						                
						                foreach ($this->columns as $column) {
						                    echo $column->render_cell($row);
						                }
						                
						                echo '</tr>';
						            }
            
	                    		} else { ?>
		                    		<!-- 没有数据 -->
		                    		<tr class="builder-data-empty">
									    <td class="text-center empty-info" colspan="9">
									        <i class="fa fa-database"></i> 暂时没有数据<br>
									    </td>
									</tr>
	                    		<?php } ?>
                    		</tbody>
                    		
                    	</table>
                    </div>
                    
                    <?php if (isset($pagination)) { ?>
                    <ul class="pagination">
                    	<?php echo $pagination->show(); ?>
                    </ul>
                    <?php } ?>
                </div>
            </div>
        </div>
    </div>

</div>